import { ref } from "vue"
import store from "@/store"
import { defineStore } from "pinia"
import { usePermissionStore } from "./permission"
import { useTagsViewStore } from "./tags-view"
import { useSettingsStore } from "./settings"
import { getToken, removeToken, setToken, getMenus, setMenus, getAppMenus, setAppMenus } from "@/utils/cache/cookies"
import router, { resetRouter } from "@/router"
import { loginApi, getUserInfoApi } from "@/api/login"
import { type LoginRequestData } from "@/api/login/types/login"
import { type RouteRecordRaw } from "vue-router"
import routeSettings from "@/config/route"
import { MenuData } from "@/layouts/components/Sidebar/types/menus"

export const useCommonStore = defineStore("common", () => {
  const tableLoading = ref<boolean>(false)
  const setLoading = (val: boolean) => {
    tableLoading.value = val
  }
  return { tableLoading, setLoading }
})
/** 在 setup 外使用 */
export function useCommonStoreHook() {
  return useCommonStore(store)
}
